package functions.ems_claim;


import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.LoggerFactory;
import com.beans.CityBean;
import com.beans.TravelStandard;
import com.crc.mam.BaseCase;
import coms.Constants;
import coms.JSONToBean;
import frame.HttpHelper;


public class Travel extends BaseCase{
	private org.slf4j.Logger logger = LoggerFactory.getLogger(Travel.class);

	TravelStandard  travel;
/*	CityBean desCity;
	CityBean startCity;*/
	

	public Travel() {
	/*	this.startCity = startCity;
		this.desCity = desCity;*/
	}
	
	public TravelStandard getTravel() {
		return travel;
	}

	public void setTravel(TravelStandard travel) {
		this.travel = travel;
	}

	

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	/**
	 * 查询出差标准
	 */
	public void findTravelStandard(String areaCode,String companyCode,String empId ,String orgCode) {
		logger.info("查询出差标准 ----------------- start ------------");
		
		String jsonString = "{\"areaCode\":\""+areaCode+"\",\"companyCode\":\""+companyCode+"\","
		    + "\"empId\":\""+empId+"\",\"orgCode\":\""+orgCode+"\"}";
		// System.out.println("findTravelStandard params ---" + jsonString);
		logger.info("findTravelStandard params : " + jsonString);
		String url = Constants.FIND_TRAVEL_STANDARD_URL;
		try {
			result = HttpHelper.post(jsonString, url);
			logger.info("findTravelStandard --- " + result);
			try {
			  travel =	JSONToBean.parseJson2Object(TravelStandard.class, result);
				//logger.info(travel.toString());
			} catch (JSONException e) {
				e.printStackTrace();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		logger.info("查询出差标准 ----------------- end ------------");
	}
}
